#ifndef _HAL_I2C_H_
#define _HAL_I2C_H_

#include "app_header.h"

struct hal_i2c_if
{
    int8_t (*i2c_init)(I2C_Type *base);
	int8_t (*i2c_write)(I2C_Type *base,uint8_t dev_addr,uint8_t reg_addr,uint8_t *w_buf,uint8_t len);
	int8_t (*i2c_read)(I2C_Type *base,uint8_t dev_addr,uint8_t reg_addr,uint8_t *r_buf,uint8_t len);
	int8_t (*i2c_analog_init)(void);
	int8_t (*i2c_analog_start)(void);
	int8_t (*i2c_analog_stop)(void);
	int8_t (*i2c_analog_wait_ack)(void);
	int8_t (*i2c_analog_write)(uint8_t data);
};

int8_t hal_i2c_init(void);
int8_t hal_i2c_write(I2C_Type *base,uint8_t dev_addr,uint8_t reg_addr,uint8_t *w_buf,uint8_t len);
int8_t hal_i2c_read(I2C_Type *base,uint8_t dev_addr,uint8_t reg_addr,uint8_t *w_buf,uint8_t len);

int8_t hal_i2c_analog_start(void);
int8_t hal_i2c_analog_stop(void);
int8_t hal_i2c_analog_wait_ack(void);
int8_t hal_i2c_analog_write(uint8_t dat);



#endif
